<#if classPath??>
package ${classPath};
</#if>


import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Id;  // 导入@Id注解
import ${classPathShort}.model.dto.${DTO};
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
<#list fieldTypes as m>
    <#if m?exists && m == "Date">
        import java.util.Date;
    </#if>
    <#if m?exists && m =="BigDecimal">
        import java.math.BigDecimal;
    </#if>
</#list>

@Data
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Table(name = "${tableName}")
@ApiModel(value = "${Entity}对象", description = "<#if tableDesc?has_content>${tableDesc?trim?replace('\n', '')}数据DO<#else>数据DO </#if>")
public class ${Entity}  implements Serializable{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty("ID")
private Long id;
<#list fieldList as m >
    @Column(name = "${m.columnName}")
    @ApiModelProperty(value = "${m.columnDesc}")
    private ${m.javaType} ${m.humpColumnName};

</#list>
public static ${Entity} convertTo${Entity}(${DTO} ${DTO ? uncap_first}) {
${Entity} ${Entity ? uncap_first}=new ${Entity}();
BeanUtils.copyProperties(${DTO ? uncap_first},${Entity ? uncap_first});
return ${Entity ? uncap_first};
}
}